<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Controller extends CI_Controller {

	/**
	 *	Bazni Kontroler za admin strane
	 */
	public function __construct()
	{
		parent::__construct();
		
		// Provera logovanja
		if( ! $this->session->userdata('admin_logged')//ako nije logovan
             || 
                ($this->session->userdata('user_group')!=2 // ili nije logovan kao moderator
                  && $this->session->userdata('user_group')!=4 // ili nije logovan kao super moderator
                )
           )                            // user_group = 2 => moderator
                                        // user_group = 4 => super moderator
		{
			//Preusmeri ga na stranu za logovanje
			$data['header'] = '';
			$data['contents'] = 'login';
			$this->load->view('main',$data);
		}
        // Load languge helper
        $this->load->helper('language');
        // Set language
        if( ! $this->session->userdata('admin_lang') )
        {
          $this->session->set_userdata('admin_lang','de');
        }
        // Load language file
        $this->lang->load($this->session->userdata('admin_lang'));
        
	}
}

/* End of file MY_Controller.php */
/* Location: ./administration/core/MY_Controller.php */